/************************************************************************************
* SongScroller.h                                                                    *
*                                                                                   *
* Copyright (C) 2011 Varuna L Amachi                                                *
*                                                                                   *
* This program is free software; you can redistribute it and/or modify              *
* it under the terms of the GNU General Public License as published by              *
* the Free Software Foundation; either version 2 of the License, or any             *
* later version.                                                                    *
*                                                                                   *
* This program is distributed in the hope that it will be useful, but               *
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY        *
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for       *
* more details. You should have received a copy of the GNU General Public           *
* License along with this program; if not, write to the Free Software Foundation,   *
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA                       *
*                                                                                   *
*************************************************************************************/

#ifndef SONGSCROLLER_H
#define SONGSCROLLER_H

#include <QWidget>
#include <QTimer>
#include <QString>
#include <QPixmap>

#include "common/MediaItem.h"

//const int DISPLAY_LENGTH = 50;

const int DISPLAY_LENGTH = 300;
const int DISPLAY_HEIGHT = 30;

//Give some breathing space.
const int X_OFFSET       = 30;


class SongScroller : public QWidget
{
    enum Progression {
        Forword,
        Backword
    };

    QTimer* m_timer;
    QString m_displayString;
    int m_startIndex;
    QPixmap* m_pixmap;
    int m_imageWidth;
    Progression m_progression;



    void drawPixmap();

public:
    SongScroller(QWidget* parent = 0);
    ~SongScroller();
    QSize sizeHint() const;

public slots:
    void setCurrentItem(MediaItem* item);
    void stop();

protected:
    void paintEvent(QPaintEvent *event);
};

#endif // SONGSCROLLER_H
